
<template>
  <div class="common-layout">
    <el-container>
      <el-header style="margin: 0; padding: 0 0 0 0"
        ><h1
          style="
            text-align: center;
            color: rgba(41, 41, 220, 0.701);
            font-size: 50px;
          "
        >
          实验室管理系统
        </h1></el-header
      >
      <el-container>
        <el-aside width="200px" id="div1" style="margin: 0">
          <!-- <el-img  src="assets/youqulogo.jpg"></el-img> -->
          <el-scrollbar height="90vh">
            <el-menu
              class="aside"
              @select="selectFunc"
              active-text-color="rgba(78, 78, 236, 0.701)"
              router="true"
              style="height: 100vh"
            >
              <el-avatar
                style="margin: 15px"
                :size="100"
                :src='this.$store.getters.getLogin.pic'
                alt=""
              ></el-avatar>
              <el-menu-item index="/addgood">
                <template #title>
                  <span
                    ><el-icon><List /></el-icon>实验室信息管理</span
                  >
                </template>
              </el-menu-item>
              <!--  预约实验室-->
              <el-menu-item index="/examine">
                <template #title>
                  <span
                    ><el-icon><OfficeBuilding /></el-icon>实验室审批管理</span
                  >
                </template></el-menu-item
              >
              <!--  预约实验室-->
              <el-menu-item index="/goodgoods">
                <template #title>
                  <span
                    ><el-icon><Histogram /></el-icon>实验室使用统计</span
                  >
                </template>
              </el-menu-item>
              <!--  预约实验室-->
              <el-menu-item index="/usage">
                <template #title>
                  <span
                    ><el-icon><UserFilled /></el-icon>用户信息</span
                  >
                </template>
              </el-menu-item>

              <el-menu-item index="/adminiinformation">
                <template #title>
                  <span
                    ><el-icon><Avatar /></el-icon>管理员信息</span
                  >
                </template>
              </el-menu-item>
            </el-menu>
          </el-scrollbar>
        </el-aside>
        <!-- 野蛮渲染 -->
        <el-main style="padding: 0; height=85vh">
          <el-header style="margin-bottom: 30px">
            <el-row justify="end">
              <el-col :span="22" :v-for="item in list"
                ><h1
                  style="
                    color: rgb(56, 56, 116);
                    font-size: 18px;
                    margin-top: 50px;
                  "
                >
                  欢迎{{this.$store.getters.getLogin.name}}，{{foo}}来到实验室管理系统！
                </h1></el-col
              >
              <el-col
                :span="1"
                style="margin: 0 auto; height: 20px; margin-top: 40px"
                ><el-button type="info" plain @click="open1"
                  ><el-icon size="28"><SwitchButton /></el-icon>退出</el-button
                >
              </el-col>
            </el-row>
          </el-header>
          <el-scrollbar height="80vh">
            <router-view></router-view>
          </el-scrollbar>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
 <script>
import axios from "axios";
import { ElNotification } from "element-plus";

export default {
  name: "Administrators",

  
  data() {
    return {
      list: [],
      imageUrl:"",
    };
  },
  methods: {
    // axios('/api/image').then(res => this.imageUrl = res.data.imageUrl)
  // } this.url=this.$store.getters.getLogin.pic
//   axios({
//   method:'get',
//   url:'/data.json'
// }).then((res)=>{
//      console.log(res)
// })
    open1() {
      axios
      .post("http://localhost:8081/admin/list", {
       name: this.name,
      
      }).then((res) => {
      this.$router.push({ name: "Login" });
          ElNotification({
           title: '管理员',
         message: this.$store.getters.getLogin.name+'退出成功',
         type: 'success',
      })
      })
    },

    
  },
};
</script>